﻿using CoreBroker;
using KWindow.KPageCore;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace IPCPages
{
    public partial class PageShowPreviewTips : PageControlBase
    {
        private Image imageReady = null;
        private Button buttonReady = null;
        private ProcessMakePreparations _process = null;
        public PageShowPreviewTips()
        {
            InitializeComponent();
            _process = ProcessMakePreparations.Instance;
            SetProcessBase(_process);
        }

        //初始化窗体数据
        public override void InitCtrls()
        {
            base.InitCtrls();
            buttonReady = GetControl<Button>("buttonReady") as Button;
            //buttonAddShutterTime = GetControl<Button>("buttonAddShutterTime") as Button;
            //buttonDecShutterTime = GetControl<Button>("buttonDecShutterTime") as Button;
            //labelBrightness = GetControl<Label>("labelBrightness") as Label;
            imageReady = GetImage("Ready");
            if (buttonReady != null)
            {
                buttonReady.Image = imageReady;
                buttonReady.TextAlign = ContentAlignment.BottomCenter;
                buttonReady.ImageAlign = ContentAlignment.TopCenter;
            }
        }

        //初始化窗体数据
        public override void InitData()
        {         
            if (buttonReady != null)
            {
                buttonReady.Enabled = true;
            }
        }

        private void buttonReady_Click(object sender, EventArgs e)
        {
            buttonReady.Enabled = false;
            _process.StartReadying();
        }
    }
}
